#include "cborder.h"

/**
 * CBorder - constructor, default settings
 */
CBorder::CBorder() {
  this->size = 1;
  this->color = CColor((unsigned char) 0, (unsigned char) 0,
      (unsigned char) 0);
  this->alpha = 255;
}
//---------------------------------------------------------------------------

/**
 * CBorder - constructor
 * @param size
 * @param color
 */
CBorder::CBorder(unsigned short size, CColor color, unsigned char alpha) {
  this->size = size;
  this->color = color;
  this->alpha = alpha;
}
//---------------------------------------------------------------------------

/**
 * getSize - returns width of bordervrati sirku okraje
 * @return border width
 */
unsigned short CBorder::getSize() const {
  return size;
}
//---------------------------------------------------------------------------

/**
 * getAlpha - returns translucency of border
 * @return border translucency
 */
unsigned char CBorder::getAlpha() const {
  return alpha;
}
//---------------------------------------------------------------------------

/**
 * getColor - returns color of border
 * @return border color
 */
CColor CBorder::getColor() const {
  return color;
}
//---------------------------------------------------------------------------

/**
 * setSize - sets width of border
 * @param size
 */
void CBorder::setSize(unsigned short size) {
  this->size = size;
}
//---------------------------------------------------------------------------

/**
 * setAlpha - sets translucency of border
 * @param alpha
 */
void CBorder::setAlpha(unsigned char alpha) {
  this->alpha = alpha;
}
//---------------------------------------------------------------------------

/**
 * setColor - sets border color
 * @param color
 */
void CBorder::setColor(CColor color) {
  this->color = color;
}
//---------------------------------------------------------------------------

/**
 * toString - returns border info
 * @return border info
 */
string CBorder::toString() {
  string str = "alpha = " + CMath<short>::toString((short) alpha) + "\n";
  str += "size = " + CMath<unsigned short>::toString(size) + "\n";
  str += "color = " + color.toString() + "\n";
  return str;
}
//---------------------------------------------------------------------------
